package com.cros.pruebas;

public class PerformanceCasting {
	public static void main(String... arv){
		String num = "1";
		
		long a = System.currentTimeMillis();
		for(int i=0;i<10000000;i++){
			if(num.equals("1")){
				
			}else if(num.equals("2")){
				
			}else if(num.equals("3")){
				
			}else if(num.equals("4")){
				
			}else if(num.equals("5")){
				
			}
		}
		System.out.println("El timepo equals:"+(System.currentTimeMillis()-a));
		int d=Integer.parseInt(num);
		long b = System.currentTimeMillis();
		for(int i=0;i<10000000;i++){
			
			if(d==1){
				
			}else if(d==2){
				
			}else if(d==3){
				
			}else if(d==4){
				
			}else if(d==5){
				
			}
		}
		System.out.println("El timepo ==:"+(System.currentTimeMillis()-b));
		
		
		long c = System.currentTimeMillis();
		for(int i=0;i<10000000;i++){
			int emi=Integer.parseInt(num);
			switch(emi){
			case 1:
				break;
			case 2:
				break;
			case 3:
				break;
			case 4:
				break;
			case 5:
				break;
			default:
				break;
			
			}
		}
		System.out.println("El timepo swithc:"+(System.currentTimeMillis()-c));
		
	}

}
